﻿(function () {
	rf.services =
		{
			settings: {
				urls: {
				},
				vars: {
				},
				elements: {
					servicesHeader: '.services .header .service-header',
					headerBg: '.header-bg'
				}
			},

			init: function (settings) {
				$.extend(true, rf.services.settings, settings);

				var $header = $(rf.services.settings.elements.servicesHeader);

				if ($header) {
					$header.hover(function () {
						var $this = $(this);
						$this.find('h4').hide();
						$(this).parent()
							.find(rf.services.settings.elements.headerBg)
							.stop(true, true)
							.animate(
								{ width: '100%' },
								'fast',
								function() {
									$this.find('h4').addClass('active').fadeIn('fast');
								});
					}, function () {
						var $this = $(this);
						$this.find('h4').hide();
						$this.parent()
							.find(rf.services.settings.elements.headerBg)
							.stop(true, true)
							.animate(
								{ width: 60 },
								'fast',
								function () {
									$this.find('h4').removeClass('active').fadeIn('fast');
								});
					});
				}
			},
		};
})();